//<div id="dview" v-show='posts.length>0'>
//<dpost v-for="p in posts" v-bind:post="p" v-bind:pid="p.id"></dpost>
//</div>

initialize('id', 'key');


let pv = new Vue({
   el:'#dpostview',
   data:{
       title:'',
       content:'',
       pid: '',
       tags:[],
       date:'2019-11-27'
     }
});
let postid = getParameter("postid");
if(postid.length > 0)
{
  getPostById(postid);
}



function getPostById(postid)
{
    var md = window.markdownit();
    findItemById('NEWPOSTS', postid, 
        function(tablename, obj)
        {

           
           pv.title = obj.get('title');
           let ht = '<h1>'+pv.title+'</h1>';
           pv.content= ht+md.render(obj.get('mdcontent'));
           pv.tags = obj.get('tags');
           pv.date = '';//convert from createat;
        },
        function(tname,error)
        {
        }
    )
}